#ifndef OPHIES_REQUEST_CALLBACK_H
#define OPHIES_REQUEST_CALLBACK_H

#include "irm_types.h"
#include <QNetworkReply>
#include <QAuthenticator>

namespace ophies {

class DataModel;

class RequestCallback : public QObject
{
    Q_OBJECT

private:
    DataModelType m_type;

public:
    RequestCallback(DataModelType type, QObject* parent);
	virtual ~RequestCallback();

protected slots:
    virtual void	onAuthenticationRequired ( QNetworkReply * reply, QAuthenticator * authenticator );
    virtual void	onFinished ( QNetworkReply * reply );
	
protected:
    virtual void onListReceived(QList<ophies::DataModel*>* list);
    virtual void onObjectReceived(ophies::DataModel* object);

public slots:
	void handlResponse( QNetworkReply *reply );

};


}

/////////////////////////////////////////////////
/// \brief The PatientsCallback class
/////////////////////////////////////////////////
class PatientsCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    PatientsCallback(RequestCallback* parent=0);
	virtual ~PatientsCallback();

};

/////////////////////////////////////////////////
/// \brief The DcmStudiesCallback class
/////////////////////////////////////////////////
class DcmStudiesCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    DcmStudiesCallback(ophies::RequestCallback* parent=0);
	virtual ~DcmStudiesCallback();
};

////////////////////////////////////////////////
/// \brief The DcmSeriesCallback class
////////////////////////////////////////////////
class DcmSeriesCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    DcmSeriesCallback(ophies::RequestCallback* parent=0);
	virtual ~DcmSeriesCallback();
};

//////////////////////////////////////////////////
/// \brief The DcmInstancesCallback class
//////////////////////////////////////////////////
class DcmInstancesCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    DcmInstancesCallback(ophies::RequestCallback* parent=0);
	virtual ~DcmInstancesCallback();

};

//////////////////////////////////////////////////
/// \brief The DocsetCallback class
//////////////////////////////////////////////////
class DocsetsCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    DocsetsCallback(ophies::RequestCallback* parent=0);
	virtual ~DocsetsCallback();
};

#endif // PATIENTSCALLBACK_H
